package kt

import android.content.Intent
import android.os.Bundle
import android.os.Handler
import android.support.v7.app.AppCompatActivity
import com.talk.debby.talk.R

import talk.activity.HomeActivity
import talk.activity.MainActivity

/**
 * Created by debby on 2018/5/8.
 * 描述:
 */
class splashActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.layout_splash)
        if (intent.flags and Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT != 0) {
            finish()
            val intent = Intent(this, HomeActivity::class.java)
            startActivity(intent)
            return
        }
        initView()
    }

    fun initView() {

    }


    override fun onResume() {
        super.onResume()
        val handler = Handler()
        handler.postDelayed({
            val intent = Intent(this, MainActivity::class.java)
            startActivity(intent)
        }, 2000)
    }
}